/*  File Name	: GatePlayer.h
 *  Author		: Pang Jiacai
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-10-15
 *  Description:
 */

#ifndef GATEPLAYER_H_
#define GATEPLAYER_H_

#include "Timer.h"
#include "CommonStruct.h"

class GateMonitor;

class GatePlayer:public PlayerBaseInfo
{
public:
	GatePlayer(int p=0);
	virtual ~GatePlayer();

	virtual int handle_timeout(void);

	void svc_id(int id);
	void cur_room(int id);
	//void switch_room(int id);
	void monitor(GateMonitor *monitor);

	int svc_id(void);
	int cur_room(void);
	//int switch_room(void);

	void login(bool login);
	bool is_login(void);

	int logout(bool exception=true);

	void reset(void);

	DBInfo &dbinfo(void);
private:
	int role_id_;
	std::string account_;
	int svc_id_;
	int cur_room_;
	//int switch_room_;
	bool login_;

	PlayerBaseInfo base_info_;
	DBInfo db_info_;
	GateMonitor *monitor_;
};

#endif /* GATEPLAYER_H_ */
